﻿function Arrow(p1, p2){

    angle = StyleDefine.Arrow.arrowAngle * Math.PI / 180;
    var upArrow = new Point(-StyleDefine.Arrow.arrowLength * Math.cos(angle), StyleDefine.Arrow.arrowLength * Math.sin(angle));
    var downArrow = new Point(-StyleDefine.Arrow.arrowLength * Math.cos(angle), -StyleDefine.Arrow.arrowLength * Math.sin(angle));
    var slope = mathHelper.Angle(p1, p2);
    upArrow.Rotation(slope.sin, slope.cos);
    downArrow.Rotation(slope.sin, slope.cos);
    upArrow.MovePoint(p2);
    downArrow.MovePoint(p2);
    return {
        "upArrow": upArrow,
        "downArrow": downArrow
    }
}
